// url地址：  http://www.baidu.com/aa?name=zs&age=18&gender=男
let url = '/aa?name=zs&age=18&gender=男'
let arr = url.split('?')
console.log(arr)
let arr2 = arr[1].split('&')
console.log(arr2)
let obj = {}
arr2.forEach(item => {
  obj[item.split('=')[0]] = item.split('=')[1]
})
console.log(obj)